From: Alessandro Bono Date: Fri, 20 Oct 2023 20:00:55 +0000 (+0200) Subject: ripples: Allow to specify whether the ripple is required X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~204^2^2~12 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=fc7e2bc65bf8016fb1c01b819be6412695448fde;p=gnome-shell.git ripples: Allow to specify whether the ripple is required The ripples are used both for the "Hot Corner" animation and for the "Locate Pointer" animation. The latter one is an accessibility feature and should always work, even when animations are disabled. Take this into account. Part-of: --- diff --git a/js/ui/ripples.js b/js/ui/ripples.js index 6785e5c21..21f5cea21 100644 --- a/js/ui/ripples.js +++ b/js/ui/ripples.js @@ -3,12 +3,13 @@ import St from 'gi://St'; // Shamelessly copied from the layout "hotcorner" ripples implementation export class Ripples { - constructor(px, py, styleClass) { + constructor(px, py, styleClass, animationRequired = false) { this._x = 0; this._y = 0; this._px = px; this._py = py; + this._animationRequired = animationRequired; this._ripple1 = new St.BoxLayout({ style_class: styleClass, @@ -58,11 +59,13 @@ export class Ripples { ripple.opacity = 255 * Math.sqrt(startOpacity); ripple.scale_x = ripple.scale_y = startScale; ripple.set_translation(-this._px * ripple.width, -this._py * ripple.height, 0.0); + const animationRequired = this._animationRequired; ripple.ease({ opacity: 0, delay, duration, + animationRequired, mode: Clutter.AnimationMode.EASE_IN_QUAD, }); ripple.ease({ @@ -70,6 +73,7 @@ export class Ripples { scale_y: finalScale, delay, duration, + animationRequired, mode: Clutter.AnimationMode.LINEAR, onComplete: () => (ripple.visible = false), });